package com.zyz.sunliky.controller;

import com.zyz.sunliky.common.ResultCommon;
import com.zyz.sunliky.service.EhsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/ehs")
@RestController
public class EhsController {

    public static final Logger logger = LoggerFactory.getLogger(EhsController.class);

    @Autowired
    EhsService ehsService;

    /**
     * 动火申请重新提交
     * @param tokenid
     * @return
     */
    @GetMapping("/hotwork")
    public ResultCommon getEhsChange(String id,String tokenid,String moduleId){
        try {
            String count = ehsService.getEhsChange(id,tokenid,moduleId);
            return new ResultCommon(count,200,"成功");
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
            return new ResultCommon(null,500,e.getMessage());
        }
    }


}
